<ion-modal-view>
  <ion-header-bar class="bar bar-royal">
    <h1 class="title">增加供应商</h1>
    <div class="buttons">
      <button class="button button-icon ion-ios-close-empty" ng-click="modal.hide();"></button>
    </div>
    </ion-header-bar>

    <ion-content class="wrap-light2">
    	<form name="addSupplierForm" ng-submit="add();" novalidate>
			<ion-list>
			
				<ion-item class="item item-input item-icon-left">
				    <i class="icon ion-ios-folder-outline dark2"></i>
				    <input type="text" name="category" maxlength="20" required placeholder="分类" ng-model="newSupplier.category">
				    <span class="ion-minus-circled" ng-show="addSupplierForm.category.$dirty && addSupplierForm.category.$invalid "></span>
				</ion-item>
				<ion-item class="item item-input item-icon-left">
				    <i class="icon ion-ios-home-outline dark2"></i>
				    <input type="text" name="name" maxlength="20" required placeholder="公司名称" ng-model="newSupplier.company">
				    <span class="ion-minus-circled" ng-show="addSupplierForm.name.$dirty && addSupplierForm.name.$invalid "></span>
				</ion-item>
				<ion-item class="item item-input item-icon-left">
				    <i class="icon ion-ios-telephone-outline dark2"></i>
				    <input type="text" name="tel" maxlength="20" required ng-model="newSupplier.tel" ng-pattern="'\\d{3,5}-\\d{6,9}'" placeholder="座机号码，例如：0755-86565252">
				    <span class="ion-minus-circled" ng-show="addSupplierForm.tel.$dirty && addSupplierForm.tel.$invalid "></span>
				</ion-item>

				<ion-item class="item-input item-icon-left">
				    <i class="icon ion-ios-location-outline dark2"></i>
				    <input type="text" name="province" maxlength="10" required placeholder="省" ng-model="newSupplier.address.province" />
				    <input type="text" name="city" maxlength="10" required placeholder="市" ng-model="newSupplier.address.city" />
				    <input type="text" name="region" maxlength="10" required placeholder="区" ng-model="newSupplier.address.region" />
			    </ion-item>
			    <ion-item class="item-input item-icon-left">
				    <input type="text" name="street" maxlength="50" required placeholder="详细地址" ng-model="newSupplier.address.street" />
				</ion-item>

				<ion-item class="margin-top-large item-divider">
				    联系人
				</ion-item>
				<div class="margin-bottom-large">
					<ion-item class="item item-input item-icon-left">
					    <i class="icon ion-ios-person-outline dark2"></i>
					    <input type="text" name="uname" maxlength="20" required placeholder="姓名" ng-model="newSupplier.contact_list[0].name">
					    <span class="ion-minus-circled" ng-show="addSupplierForm.uname.$dirty && addSupplierForm.uname.$invalid "></span>
					</ion-item>

					<ion-item class="item item-input item-icon-left">
					    <i class="icon ion-iphone dark2"></i>
					    <input type="text" name="phone" maxlength="11" required placeholder="手机号码" ng-model="newSupplier.contact_list[0].mobile">
					    <span class="ion-minus-circled" ng-show="addSupplierForm.phone.$dirty && addSupplierForm.phone.$invalid "></span>
					</ion-item>

					<ion-item class="item item-input item-icon-left">
					    <i class="icon ion-ios-email-outline dark2"></i>
					    <input type="email" name="email" maxlength="30" required placeholder="E-Mail" ng-model="newSupplier.contact_list[0].email">
					    <span class="ion-minus-circled" ng-show="addSupplierForm.email.$dirty && addSupplierForm.email.$invalid "></span>
					</ion-item>
				</div>

				<ion-item class="item item-input item-icon-left">
				    <textarea rows="3" ng-model="newSupplier.remark" placeholder="备注"></textarea>
				</ion-item>

		        <button class="button button-block button-balanced" type="submit">保存</button>
			</ion-list>
	  	</form>
	</ion-content>
</ion-modal-view>